package com.cyy.singleton_pattern;

public class HungerDemo {
    public static void main(String[] args) {
        //创建Aa对象
        HungryMode Aa = HungryMode.getInstance();
        //创建Bb对象
        HungryMode Bb = HungryMode.getInstance();

        Aa.setName("小明");

        System.out.println(Aa.getName());
        System.out.println(Bb.getName());
    }
}
